package parser;
import java.io.File;
import java.util.Collection;

import uml.XMIOutputter;
import uml.XMIVisitor;

import components.ClassDiagram;

class Main {
	public static long lexerTime = 0;
	public static boolean profile = false;
	static JavaLexer lexer;

	public static void main(String[] args){
		// parsowanie
		PackagesParser parser = new PackagesParser();
		Collection<components.Package> packages = parser.parse(args).values();

		try {
			// tworzenie uml'a
			ClassDiagram cd = new ClassDiagram(packages);
			XMIOutputter out = new XMIOutputter();
			XMIVisitor visitor = new XMIVisitor(out);
			visitor.visit(cd);
			System.out.println(out.toString());
			
			out.commit();
			out.store(new File("result.xml"));
			
			// wydruk
			//parser.printPackages();
		} catch (Exception e) {
			e.printStackTrace();
		}

	}	
}